package 力扣;

import java.util.ArrayList;
import java.util.List;

/**
 * @author yyq
 * @create 2022-06-14 16:48
 */
public class leetcode70 {
    public static void main(String[] args) {
        leetcode70 leetcode70=new leetcode70();
        System.out.println(leetcode70.climbStairs(44));
    }


    public int climbStairs(int n) {
        if(n<=2) return n;
        int a=1;
        int b=2;
        int fn=0;
        for (int i=3;i<=n;i++){
            fn = a + b;
            a = b;
            b = fn;
        }
        return fn;

    }



}
